package com.anycl.design.creation.prototype;

import java.util.Date;

public class Person implements Cloneable {

    private int age;
    private Date birth;

    private Address address;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        // return super.clone();
        Person p = (Person) super.clone();
        p.birth = (Date) birth.clone();
        p.address = (Address) address.clone();
        return p;
    }

    public Person(int age, Date birth) {
        this.age = age;
        this.birth = birth;
    }

    public Person(int age, Date birth, Address address) {
        this.age = age;
        this.birth = birth;
        this.address = address;
    }

    public Person() {
    }

    public int getAge() {
        return age;
    }

    public Date getBirth() {
        return birth;
    }

    public Address getAddress() {
        return address;
    }
}
